<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<script type=text/javascript>
 function show(id){
 	document.getElementById("hidden"+id).style.display='block';
 	document.getElementById("href"+id).href='javascript:hidden('+id+');';
 	document.getElementById("span"+id).innerHTML="收起";
 	document.getElementById("a"+id).href='javascript:hidden('+id+');';
 }
 function hidden(id){
 	document.getElementById("hidden"+id).style.display='none';
 	document.getElementById("href"+id).href='javascript:show('+id+');';
 	document.getElementById("span"+id).innerHTML="查看详细";
 	document.getElementById("a"+id).href='javascript:show('+id+');';
 }
 </script>

<div align="center">
   <table class="main">
      <tr align="left"><td valign="top">
         <div id="location"><img src="<%=basePath %>images/c4.jpg" style="margin-left:15px;"/>&nbsp;&nbsp;当前位置：&nbsp;意向题目</div>
         <div id="content">
            <c:if test="${intents.size()==0 }"><p>您还没有意向题目！</p></c:if>
            <c:if test="${intents.size()>0 }">
             <% int i = 0; %>
              <c:forEach items="${intents}" var="in">
                 <table width="100%" class="list" ><from>
                     <% i++; %>
                     <tr align="left" style="border-bottom:1px #ccc solid;"><td><a href="javascript:show(<%=i %>);" style="color:#349C9F;" id="a<%=i %>">${in.project.name }</a>                       
                        <c:if test="${available==true }">
                           <span>
                              <input type="button" value="上移" class="btn up">
                              <input type="button" value="下移" class="btn down">
                              <input type="button" value="移除" class="btn remove"> 
                              <input type="hidden" value="${in.id }" class="id" />
                              <input type="hidden" value="${in.level }" class="level" />
                           </span>
                        </c:if>
                        <a id="href<%=i %>" href="javascript:show(<%=i %>);"><span id="span<%=i %>">查看详细</span></a>
                     </td></tr>
                     <tr><td>
               <table id="hidden<%=i %>" style="display:none;border-bottom:1px #999 solid;" >
                  <tr align="left"><td class="span">题目描述:</td></tr>
                  <tr align="left"><td>${in.project.description }</td></tr>
                  <tr align="left"><td class="span">导师信息:</td></tr>
                  <tr align="left"><td><div>导师姓名：${in.project.teacher.name }</div><div>性别：${in.project.teacher.gender }</div>
                     <div>联系电话：${in.project.teacher.telephone }</div><div>&nbsp;q&nbsp;&nbsp;q：${in.project.teacher.qq }</div></td></tr>
                  <tr align="left"><td class="span">给导师的留言:</td></tr>
                  <c:if test="${available==true }">
                     <tr align="left"><td><textarea rows="" cols="105" class="message">${in.message }</textarea><br />
                        <input type="button" value="更改留言" class="updateMessage" style="margin-left:300px;margin-top:10px;margin-bottom:10px;">
                        <input type="hidden" class="iid" value="${in.id }"><br />
                     </td></tr>
                  </c:if>
                  <c:if test="${available==false }">
                     <tr align="left"><td><textarea rows="" cols="105" class="message"  disabled="disabled">${in.message }</textarea><br /><br />
                     </td></tr>
                  </c:if>
               </table></td></tr>
         </from></table>
         </c:forEach>
        <br /><c:if test="${available==true }"><p align="center">点击“上移”或“下移”调整意向优先级</p></c:if>
         </c:if>
         <p>&nbsp;</p>
      </div>
          
      </td></tr>
   </table>
   
</div>

